#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e4+100;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
class SummaryRanges {
int fa[maxn],siz[maxn];
bool vis[maxn];
public:
    int find(int x){
        if(fa[x]!=x) return fa[x]=find(fa[x]);
        return fa[x];
    }
    void un(int x,int y){
        int u=find(x);int v=find(y);
        if(u!=v){
            if(siz[u]>siz[v]){
                siz[u]+=siz[v];
                fa[v]=u;
            }
            else{
                siz[v]+=siz[u];
                fa[u]=v;
            }
        }
    }
    SummaryRanges() {
        for(int i=0;i<maxn;i++) fa[i]=i,siz[i]=1,vis[i]=0;
    }
    void addNum(int val) {
        vis[val]=true;
        int lval=max(0,val-1); int rval=val+1;
        if(vis[lval]) un(val-1,val);
        if(vis[rval]) un(val,val+1);
    }
    vector<vector<int>> getIntervals() {
        vector<vector<int>>ans;
        for(int i=0;i<10000;i++){
            if(!vis[i]) continue;
            int l=i;
            int r=i+siz[find(i)]-1;
            vector<int>v;
            v.push_back(l);v.push_back(r);
            ans.push_back(v);
            i=r;
        }
        return ans;
    }
};

int main(void){
   	cin.tie(0);std::ios::sync_with_stdio(false);

   	return 0;
}
